// request => axios
import request from '@/utils/request'

export function getDepartmentList() {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

export function addDepartment(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
// 重新根据id 获取详情部门 回填数据接口
export function getDepartmentById(id) {
  return request({
    method: 'get',
    url: '/company/department/' + id
  })
}
// 编辑后根据 id 保存数据更新
export function updateDepartmentById(data) {
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}
// 根据 id 删除部门
export function deleteDepartmentById(id) {
  return request({
    method: 'delete',
    url: '/company/department/' + id
  })
}
